class People {
  name: string
  age: number
  constructor(name: string, age: number) {
    this.name = name
    this.age = age
  }
  eat() {
    console.log(`${this.name}今年${this.age}岁`)
  }
}

class Son extends People {
  adress: string
  constructor(name: string, age: number, adress: string) {
    // super还可以调用父类函数
    super(name, age)
    this.adress = adress
  }
}

let son = new Son('小明', 20, '长春')

console.log(son, son.eat)
export {}